home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
mxcode
/
gsrc211
/
config.asm
< prev
next >
Wrap
Assembly Source File
|
1994-03-08
|
3KB
|
122 lines
proc ReadGConfig
push ds
mov ax,MyData
mov ds,ax
mov si,offset GConfigFile
call PutName
mov dx,offset GDirectory
mov cx,seg GDirectory
mov ds,cx
mov ax,3D00h
int 21h
jb @@NoFind
mov bx,ax
mov cx,11
mov ax,cs
mov ds,ax
mov dx,offset GUSPort
mov ah,3Fh
int 21h
mov ah,3Eh
int 21h
pop ds
ret
@@NoFind: mov dx,offset NoGCFound
call Error
pop ds
ret
endp ReadGConfig
; si - offset Config file name
proc ReadConfig
push ds
mov ax,MyData
mov ds,ax
call PutName
mov dx,offset GDirectory
mov cx,seg GDirectory
mov ds,cx
mov ax,3D00h
int 21h
jb @@SetInfo
mov bx,ax
mov cx,11
mov ax,cs
mov ds,ax
mov dx,offset Mode
mov ah,3Fh
int 21h
mov ah,3Eh
int 21h
@@SetInfo: call GetInfo
mov al,[cs:MaxVol]
mov [cs:offset MMus+(offset (SMus).MaxVolume)],al
mov al,[cs:PlayStat]
mov [cs:offset MMus+(offset (SMus).PlayStatus)],al
mov cx,00000011b
call SetInfo
cli
les di,[cs:offset MMus+(offset (SMus).ChannelLoc)]
mov bx,0
@@CopyLoop: mov al,[cs:bx+PanPos]
mov [es:di+MS.sc_PanPosition],al
mov al,[cs:bx+ChanVol]
mov [es:di+MS.MasterVolume],al
add di,size MS
inc bx
cmp bx,4
jnz @@CopyLoop
sti
call GetInfo
call Ed_Percent
call Ed_Pan
call Ed_PlayStatus
@@NoFind: pop ds
ret
endp ReadConfig
; si - Config Name
proc WriteConfig
push ds
mov ax,MyData
mov ds,ax
call PutName
mov dx,offset GDirectory
mov cx,seg GDirectory
mov ds,cx
mov cx,0
mov ah,3Ch
int 21h
jb @@NoFind
push ax
call GetInfo
cli
les di,[cs:offset MMus+(offset (SMus).ChannelLoc)]
mov bx,0
@@CopyLoop: mov al,[es:di+MS.sc_PanPosition]
mov [cs:bx+PanPos],al
mov al,[es:di+MS.MasterVolume]
mov [cs:bx+ChanVol],al
add di,size MS
inc bx
cmp bx,4
jnz @@CopyLoop
mov al,[cs:offset MMus+(offset (SMus).MaxVolume)]
mov [cs:MaxVol],al
mov al,[cs:offset MMus+(offset (SMus).PlayStatus)]
mov [cs:PlayStat],al
sti
pop bx
mov cx,11
mov ax,cs
mov ds,ax
mov dx,offset Mode
mov ah,40h
int 21h
mov ah,3Eh
int 21h
@@NoFind: pop ds
ret
endp WriteConfig